import {createApp} from 'vue'
import App from '@/App.vue'
//引入element
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//引入自定义插件对象:注册整个项目全局组件
import gloalComponent from '@/components'
//引入仓库
import pinia from "./store";
//导入router
import router from "@/router";
//引入默认样式
import '@/assets/styles/index.scss' // global css
import '@/styles/index.scss'
//element中文
//@ts-ignore忽略当前文件ts类型的检测
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// SvgIcon组件
import 'virtual:svg-icons-register';
import SvgIcon from "@/components/SvgIcon/index.vue";
// 分页组件
import Pagination from '@/components/Pagination/index.vue'
// 自定义表格工具组件
import RightToolbar from '@/components/RightToolbar/index.vue'
//自定义指令
import directive from '@/directive'
//获取应用实例对象
const app = createApp(App)
//安装自定义插件
app.use(gloalComponent)
//安装仓库
app.use(pinia)
//注册模板路由
app.use(router)
app.use(ElementPlus, {
    locale: zhCn,
})
// 全局注册组件
app.component('svg-icon', SvgIcon)
app.component('Pagination', Pagination)
app.component('RightToolbar', RightToolbar)

directive(app)

//引入路由鉴权文件
import './permission.ts'

//将应用挂载到挂载点上
app.mount('#app')
